<template>
  <div class="character-attribute">
    <p>等级：{{ character.attribute.level }}</p>
    <p>生命：{{ character.attribute.hp.current }} / {{ character.attribute.hp.max }}</p>
    <p>魔法：{{ character.attribute.mp.current }} / {{ character.attribute.mp.max }}</p>
    <p>经验值：{{ character.attribute.exp.current }} / {{ character.attribute.exp.max }}</p>
    <p>物理攻击：{{ character.attribute.atk }}</p>
    <p>物理防御：{{ character.attribute.def }}</p>
    <p>攻速：{{ aspdShow }} / 秒</p>
    <p>生命恢复速度：{{ hpRecoverySpeedShow }} % / 秒</p>
  </div>
</template>

<script>
export default {
  name: 'CharacterAttribute',

  data() {
    return {
      character: {}
    }
  },

  computed: {
    aspdShow() {
      return this.$util.transformDecimal((this.character.attribute.aspd / 1000), 2)
    },
    hpRecoverySpeedShow() {
      return Math.round(this.character.attribute.hp.recoverySpeed * 100)
    }
  },

  beforeMount() {
    this.character = this.$game.tempData.character
  }
}
</script>

<style lang="scss">

</style>
